import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/index/Login.vue'
import Register from '../views/index/Register.vue'
import Home from '../views/Home/home.vue'
import Cart from '../views/cart/index.vue'
import My from '../views/my/index.vue'
import OrderList from '../views/orders/index.vue'
import ShopInfo from '../views/Home/components/shopInfo.vue'

// import VueRouter from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/login',
    name: 'login',
    component:Login
  },
  {
    path: '/register',
    name: 'register',
    component: Register,
  },
  {
    path: '/my',
    name: 'my',
    component: My,
  },
  {
    path: '/orderList',
    name: 'orderList',
    component: OrderList,
  },
  {
    path: '/cart',
    name: 'cart',
    component: Cart,
  },
  {
    path: '/shopInfo',
    name: 'shopinfo',
    component: ShopInfo,
  },
  {
    path: '/shopProductsInfo/:id',
    name: 'shopProductsInfo',
    component: () => import('../components/ShopProductsInfo.vue')
  },
  {
    path: '/comfirmOrder/:id',
    name: 'comfirmOrder',
    component: ()=>import('../views/orders/confirmOrder.vue'),
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
